import React, { Component } from 'react'
import Item from '../Item'
import PropTypes from 'prop-types'
import './index.css'

export default class List extends Component {
	static propTypes = {
		todos:PropTypes.array.isRequired
	}
	render() {
		return (
			<ul className="todo-main">
				{
					this.props.todos.map((todoObj)=>{
						return <Item key={todoObj.id} {...todoObj}/>
					})
				}
			</ul>
		)
	}
}
